<?php
class Sorter {
	
	public function __construct($options = array()) {
		
	}
	
	public function sort($data = array(), $field = null) {
		$timestamps = array();
		foreach ($data as $key => $node) {
			$timestamps[$key] = $node[$field]; 
		}
		
		arsort($timestamps, SORT_NUMERIC);
		
		$sorted = array();
		foreach ($timestamps as $key => $timestamp) {
			$sorted[$key] = $data[$key];
		}
		
		return $sorted;
	}
	
}
?>
